package com.yuexunit.operationman.nbsy.module.SafeOperation.ui.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.yuexunit.operationman.nbsy.R;
import com.yuexunit.operationman.nbsy.config.AppConfig;
import com.yuexunit.operationman.nbsy.module.SafeOperation.bean.SafeOperationBean;
import com.yuexunit.operationman.nbsy.module.SafeOperation.ui.Act_SafeOperation_Preview;

import org.kymjs.kjframe.ui.KJFragment;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by work-jx on 2017/7/11.
 */
public class Fragment_SO_BeforeNarcosis extends KJFragment {
    @Bind(R.id.frag_so_bn_tv_01)
    TextView fragSoBnTv01;
    @Bind(R.id.frag_so_bn_tv_02)
    TextView fragSoBnTv02;
    @Bind(R.id.frag_so_bn_tv_03)
    TextView fragSoBnTv03;
    @Bind(R.id.frag_so_bn_tv_04)
    TextView fragSoBnTv04;
    @Bind(R.id.frag_so_bn_tv_05)
    TextView fragSoBnTv05;
    @Bind(R.id.frag_so_bn_tv_06)
    TextView fragSoBnTv06;
    @Bind(R.id.frag_so_bn_tv_07)
    TextView fragSoBnTv07;
    @Bind(R.id.frag_so_bn_tv_08)
    TextView fragSoBnTv08;
    @Bind(R.id.frag_so_bn_tv_09)
    TextView fragSoBnTv09;
    @Bind(R.id.frag_so_bn_tv_10)
    TextView fragSoBnTv10;
    @Bind(R.id.frag_so_bn_tv_11)
    TextView fragSoBnTv11;
    @Bind(R.id.frag_so_bn_tv_12)
    TextView fragSoBnTv12;
    @Bind(R.id.frag_so_bn_tv_13)
    TextView fragSoBnTv13;
    @Bind(R.id.frag_so_bn_tv_14)
    TextView fragSoBnTv14;
    @Bind(R.id.frag_so_bn_tv_15)
    TextView fragSoBnTv15;
    @Bind(R.id.frag_so_bn_tv_16)
    TextView fragSoBnTv16;
    @Bind(R.id.frag_so_bn_tv_17)
    TextView fragSoBnTv17;
    private Act_SafeOperation_Preview aty;
    protected View mMainView;

    @Override
    protected View inflaterView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        aty = (Act_SafeOperation_Preview) getActivity();
        mMainView = layoutInflater.inflate(R.layout.fragment_so_beforenarcosis, viewGroup, false);
        ButterKnife.bind(this, mMainView);
        return mMainView;
    }

    @Override
    protected void initData() {
        for(SafeOperationBean.ObjectEntity.SecurityItemListEntity p : AppConfig.SAFEOPERATIONBEAN.getObject().getSecurityItemList()){
            switch (p.getItemCode())
            {
                case "MZ_HuanZheXinXi":
                    if(p.getItemValue().equals("1"))
                    {
                        fragSoBnTv01.setText("是");
                    }
                    else if (p.getItemValue().equals("0")){
                        fragSoBnTv01.setText("否");
                    }
                    break;
                case "MZ_ShouShuFangShi":
                    if(p.getItemValue().equals("1"))
                    {
                        fragSoBnTv02.setText("是");
                    }
                    else if (p.getItemValue().equals("0")){
                        fragSoBnTv02.setText("否");
                    }
                    break;
                case "MZ_ShouShuBuWei":
                    if(p.getItemValue().equals("1"))
                    {
                        fragSoBnTv03.setText("是");
                    }
                    else if (p.getItemValue().equals("0")){
                        fragSoBnTv03.setText("否");
                    }
                    break;
                case "MZ_ShouShuZhiQing":
                    if(p.getItemValue().equals("1"))
                    {
                        fragSoBnTv04.setText("是");
                    }
                    else if (p.getItemValue().equals("0")){
                        fragSoBnTv04.setText("否");
                    }
                    break;
                case "MZ_MaZuiZhiQing":
                    if(p.getItemValue().equals("1"))
                    {
                        fragSoBnTv05.setText("是");
                    }
                    else if (p.getItemValue().equals("0")){
                        fragSoBnTv05.setText("否");
                    }
                    break;
                case "MZ_MaZuiFangShi":
                    if(p.getItemValue().equals("1"))
                    {
                        fragSoBnTv06.setText("是");
                    }
                    else if (p.getItemValue().equals("0")){
                        fragSoBnTv06.setText("否");
                    }
                    break;
                case "MZ_MaZuiSheBeiAnQuan":
                    if(p.getItemValue().equals("1"))
                    {
                        fragSoBnTv07.setText("是");
                    }
                    else if (p.getItemValue().equals("0")){
                        fragSoBnTv07.setText("否");
                    }
                    break;
                case "MZ_PiFuWanZheng":
                    if(p.getItemValue().equals("1"))
                    {
                        fragSoBnTv08.setText("是");
                    }
                    else if (p.getItemValue().equals("0")){
                        fragSoBnTv08.setText("否");
                    }
                    break;
                case "MZ_ShuQianPiFuZhunBei":
                    if(p.getItemValue().equals("1"))
                    {
                        fragSoBnTv09.setText("是");
                    }
                    else if (p.getItemValue().equals("0")){
                        fragSoBnTv09.setText("否");
                    }
                    break;
                case "MZ_JingMaiTongDaoJianLi":
                    if(p.getItemValue().equals("1"))
                    {
                        fragSoBnTv10.setText("是");
                    }
                    else if (p.getItemValue().equals("0")){
                        fragSoBnTv10.setText("否");
                    }
                    break;
                case "MZ_HuanZheGuoMingShi":
                    if(p.getItemValue().equals("1"))
                    {
                        fragSoBnTv11.setText("是");
                    }
                    else if (p.getItemValue().equals("0")){
                        fragSoBnTv11.setText("否");
                    }
                    break;
                case "MZ_KangJunYaoWuPiShi":
                    if(p.getItemValue().equals("1"))
                    {
                        fragSoBnTv12.setText("是");
                    }
                    else if (p.getItemValue().equals("0")){
                        fragSoBnTv12.setText("否");
                    }
                    break;
                case "MZ_ShuQianBeiXue":
                    if(p.getItemValue().equals("1"))
                    {
                        fragSoBnTv13.setText("是");
                    }
                    else if (p.getItemValue().equals("0")){
                        fragSoBnTv13.setText("否");
                    }
                    break;
                case "MZ_JiaTi":
                    if(p.getItemValue().equals("1"))
                    {
                        fragSoBnTv14.setText("是");
                    }
                    else if (p.getItemValue().equals("0")){
                        fragSoBnTv14.setText("否");
                    }
                    break;
                case "MZ_TiNeiZhiRuWu":
                    if(p.getItemValue().equals("1"))
                    {
                        fragSoBnTv15.setText("是");
                    }
                    else if (p.getItemValue().equals("0")){
                        fragSoBnTv15.setText("否");
                    }
                    break;
                case "MZ_YingXiangXueZiLiao":
                    if(p.getItemValue().equals("1"))
                    {
                        fragSoBnTv16.setText("是");
                    }
                    else if (p.getItemValue().equals("0")){
                        fragSoBnTv16.setText("否");
                    }
                    break;
                case "MZ_Other":
                    fragSoBnTv17.setText(p.getItemValue());
                    break;
            }
        }
    }


}
